package com.java.base.exercise;

import com.alibaba.fastjson.JSON;
import org.apache.poi.hssf.record.DVALRecord;

import java.math.BigDecimal;
import java.util.*;

import static cn.hutool.core.util.NumberUtil.add;

/**
 * @Author RenPu
 * @Date 2022/6/9 16:10
 * @Version 1.0
 * @Description:
 **/
public class test66 {

    static final int MAXIMUM_CAPACITY = 1073741824;

    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>(Arrays.asList(1,5,24,8,38));
        System.out.println("排序前的结果集：{------------}"+list);
        Arrays.sort(list.toArray());
        System.out.println("排序后后后后的结果集：{------------}"+list);

//        List<String> list1 = new ArrayList<String>(10);
//        list1.add(2, "1");
//        System.out.println(list1);


        //初始化一个由10个88888组成的集合。
        ArrayList<Integer> list4 = new ArrayList<Integer>(Collections.nCopies(10, 88888));
        System.out.println(list4);



        int[] oldArr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

//        int [] newArr=new int[12];
        System.arraycopy(oldArr,3,oldArr,2,7);
        System.out.println(JSON.toJSONString(oldArr));

        ArrayList<String> list6 = new ArrayList<>(Collections.nCopies(8,"0"));

        list6.set((("a".hashCode())&8-1),"a");
        list6.set((("b".hashCode())&8-1),"b");
        list6.set((("c".hashCode())&8-1),"c");
        list6.set((("d".hashCode())&8-1),"d");
        list6.set((("e".hashCode())&8-1),"e");

        String a = list6.get(("a".hashCode()) & 8 - 1);
        System.out.println("获取值为：{------结果----}："+a);

        System.out.println("根据字母进行哈希求值后的结果{---}:"+(("a".hashCode())&8-1));
        System.out.println("根据字母进行哈希求值后的结果{---}:"+(("b".hashCode())&8-1));
        System.out.println("根据字母进行哈希求值后的结果{---}:"+(("c".hashCode())&8-1));
        System.out.println("根据字母进行哈希求值后的结果{---}:"+(("d".hashCode())&8-1));
        System.out.println("根据字母进行哈希求值后的结果{---}:"+(("e".hashCode())&8-1));







    }




}
